package cn.com.nes.site.entity.em.ctce;

import cn.hutool.core.util.ObjectUtil;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 安装状态
 */
public enum AzztEnum {
    DAZ("11", "待安装"), AZZ("12", "安装中"), AZWB("13", "安装完毕");

    private final String key;

    private final String val;

    AzztEnum(String key, String val) {
        this.key = key;
        this.val = val;
    }

    public String getKey() {
        return key;
    }

    public String getVal() {
        return val;
    }

    public static String getVal(String key) {
        Map<String, String> map = Arrays.stream(values()).collect(Collectors.toMap(AzztEnum::getKey, AzztEnum::getVal));
        return ObjectUtil.isNull(key) ? "" : map.get(key);
    }
}
